package com.example.wang.myapplication;

import com.google.gson.annotations.Expose;

import java.io.Serializable;

/**
 * 文 件 名 : BaseData 创 建 人： gejian 日 期：2015-1-20 修 改 人： gejian 日 期：2015-1-20 描 述：
 * 基本数据结构
 */
public class DataResult<T> implements Serializable{

	public static final int RESULT_Cache = -1;
	
	public static final String RESULT_OK = "200";// 发送成功
	public static final String TOKEN_WRONG = "104";// TOKEN过期

	@Expose
	private String message = ""; // 错误时返回错误原因,成功返回"OK"
	@Expose
	private String status =""; // 返回的状态码,200成功，默认302失败
	private String rescode;
	private String totlecount = "0";
	@Expose
	private String command = ""; // 接口命令
	@Expose
	private T data; // 数据返回
	@Expose
	private int[] page; // 页码


	Class<T> type;

	public DataResult() {
		this.type = (Class<T>) getClass();
	}

	public int[] getPage() {
		if (page == null) {
			page = new int[3];
		}
		return page;
	}

	

	public String getTotlecount() {
		return totlecount;
	}



	public void setTotlecount(String totlecount) {
		this.totlecount = totlecount;
	}





	public String getRescode() {
		return rescode;
	}



	public void setRescode(String rescode) {
		this.rescode = rescode;
	}



	public String getMsg() {
		return message;
	}



	public void setMsg(String msg) {
		this.message = msg;
	}



	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public String getCommand() {
		return command;
	}

	public void setCommand(String command) {
		this.command = command;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
}
